var mongoose = require('mongoose');

var userSchema = new mongoose.Schema({
  "userId": String,
  "userName": String,
  "userPwd": String,
  "orderList": Array,
  "cartList":[{
    "productId":String,
    "productName": String,
    "productImage": String,
    "salePrice": String,
    "checked":String,
    "productNum":Number
  }],
  "addressList":[{
    addressId: String,
    userName: String,
    streetName: String,
    postCode: Number,
    tel: Number,
    isDefault: Boolean
  }],
});

module.exports = mongoose.model("User",userSchema);//通过Model可以实例化出文档对象document之后将其导出
